﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using NUnit.Framework;
using Agility.ViewModels.LoginUI;

namespace Agility.Testing.Silverlight.ViewModels
{
    [TestFixture]
    public class LoginInfoTests
    {
        
        #region optional setup and tear down methods
        //// Called before the first test to setup the whole fixture
        //[TestFixtureSetUp]
        //public void TestFixtureSetup()
        //{
        //}

        //// Called after the last test to tear down the whole fixture
        //[TestFixtureTearDown]
        //public void TestFixtureTearDown()
        //{
        //}

        //// Called before each test
        //[SetUp]
        //public void TestSetup()
        //{
        //}

        //// Called after each test
        //[TearDown]
        //public void TestTearDown()
        //{ 
        //}

        #endregion

        [Test]
        [Category("UnitTest")]
        public void TestUserName()
        {
            // Arrange
            LoginInfo target = new LoginInfo();
            string expected = "User";
            string actual = string.Empty;

            // Act
            target.UserName = expected;
            actual = target.UserName;

            // Assert
            Assert.AreEqual(expected, actual);
        }

        [Test]
        [Category("UnitTest")]
        public void TestPassword()
        {
            // Arrange
            LoginInfo target = new LoginInfo();
            string expected = "This is the password.";
            string actual = string.Empty;

            // Act
            target.PasswordAccessor = () => expected;
            actual = target.Password;

            // Assert
            Assert.AreEqual(expected, actual);
        }

        [Test]
        [Category("UnitTest")]
        public void TestRememberMe()
        {
            // Arrange
            LoginInfo target = new LoginInfo();
            bool expected = true;

            // Act
            target.RememberMe = expected;

            // Assert
            Assert.IsTrue(expected);
        }
    }
}
